import { createRouter, createWebHistory } from 'vue-router';

const routes = [
  // 异步加载首页组件  
  {
    name: '登录',
    path: '/login',  // 使用根路径作为首页  
    component: () => import('@/views/Login.vue')
  },
  {
    name: '框架页',
    path: '/',  // 使用根路径作为首页  
    component: () => import('@/views/Framework.vue'),
    redirect: '/blog/list',
    children: [{
      path: '/blog/list',
      name: '博客管理',
      component: () => import('@/views/blog/BlogList.vue'),
    }, {
      path: '/blog/category',
      name: '分类管理',
      component: () => import('@/views/blog/BlogCategory.vue'),
    },
    {
      path: '/blog/test',
      name: '测试',
      component: () => import('@/views/blog/Test.vue'),
    },
    {
      path: '/special/list',
      name: '专题管理',
      component: () => import('@/views/special/SpecialList.vue'),
    },
    {
      path: '/settings/my',
      name: '个人信息',
      component: () => import('@/views/settings/MyInfo.vue'),
    },
    {
      path: '/settings/user',
      name: '博客成员',
      component: () => import('@/views/settings/TeamUser.vue'),
    },
    {
      path: '/settings/sysSetting',
      name: '系统设置',
      component: () => import('@/views/settings/SysInfo.vue'),
    },
    {
      path: '/recovery/list',
      name: '回收站',
      component: () => import('@/views/recovery/Recovery.vue'),
    }
    ]
  },

];

const router = createRouter({
  history: createWebHistory(),
  routes  // 正确传递路由配置数组   
});

export default router;